﻿using Microsoft.Extensions.DependencyInjection;
using PLCS.App.EquipmentManager.ViewModels.Equipment;
using PLCS.App.EquipmentManager.ViewModels.Station;
using PLCS.App.EquipmentManager.ViewModels.Tray;
using PLCS.App.EquipmentManager.Views.Equipment;
using PLCS.App.EquipmentManager.Views.Station;
using PLCS.App.EquipmentManager.Views.Tray;
using PLCS.App.Shared;
using PLCS.Client.IService.LogManager;
using PLCS.Client.Service.EquipmentManager;
using PLCS.Client.Service.LogManager;
using Prism.Ioc;
using Prism.Modularity;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;

namespace PLCS.App.EquipmentManager;

[DependsOn(typeof(AppSharedModule))]
public class EquipmentManagerModule : AbpModule, IModule
{
    public void OnInitialized(IContainerProvider containerProvider)
    {
    }

    public void RegisterTypes(IContainerRegistry containerRegistry)
    {
        containerRegistry.RegisterForNavigation<EquipmentView, EquipmentViewModel>();
        containerRegistry.RegisterForNavigation<EquipmentDetailView, EquipmentDetailViewModel>();

        containerRegistry.RegisterForNavigation<StationView, StationViewModel>();
        containerRegistry.RegisterForNavigation<StationDetailView, StationDetailViewModel>();
        containerRegistry.RegisterForNavigation<TrayView, TrayViewModel>();
        containerRegistry.RegisterForNavigation<TrayDetailView, TrayDetailViewModel>();
    }

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAutoMapperObjectMapper<EquipmentManagerModule>();

        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<EquipmentManagerModule>();
        });
    }
}